import request from '@/utils/request'
import { getServicePath } from '@/api/baseUrlConfig'
const servicePath = getServicePath()

// 查询组织树
export function tree (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/org-info-mgmt/queryTree`,
    method: 'get',
    params: data
  })
}
// 根据名称查询组织树
export function queryTree (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/org-info-mgmt/queryTreeByCondition`,
    method: 'get',
    params: data
  })
}
// 添加组织
export function addOrg (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/org-info-mgmt/add`,
    method: 'post',
    data
  })
}

// 编辑组织
export function editOrg (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/org-info-mgmt/edit`,
    method: 'post',
    data
  })
}

// 删除组织
export function deleteOrg (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/org-info-mgmt/deleteById/${data.id}`,
    method: 'get',
    params: data
  })
}

// 查询组织列表
export function list (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + '/org-info-mgmt/queryList',
    method: 'get',
    params: data
  })
}

// id查询组织
export function queryById (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/org-info-mgmt/queryById/${data.id}`,
    method: 'get',
    params: data
  })
}

// 分页查询组织列表
export function queryByCondition (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/org-info-mgmt/queryByCondition`,
    method: 'get',
    params: data
  })
}

// 查询党员列表
export function queryPersonList (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/party-member-info-mgmt/queryList`,
    method: 'get',
    params: data
  })
}
